<?php
require_once ("../db/connectdatabase.php");

function insertAdvertise($id, $tieude, $noidung, $date) {
	$con = new ConnectDB();
	$tbl = "thongbaodealer";
	$fn = array('id' => $id, 'titletb' => $tieude, 'message' => $noidung, 'datecreate' => $date);
	return $con -> insert($tbl, $fn);
}

function updateAdvertise($id, $tieude, $noidung) {
	$con = new ConnectDB();
	$tbl = "thongbaodealer";
	$fn = array('titletb' => $tieude, 'message' => $noidung);
	$condition = array('id' => $id);
	return $con -> update($tbl, $fn, $condition);
}

function deleteAdvertise($id, $use) {
	$con = new ConnectDB();
	$tbl = "thongbaodealer";
	$fn = array('isuse' => $use);
	$condition = array('id' => $id);
	return $con -> update($tbl, $fn, $condition);
}


function removeAdvertise($id) {
	$con = new ConnectDB();
	$tbl = "thongbaodealer";
	$condition = array('id' => $id);
	return $con -> delete($tbl, $condition);
}
?>